﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Windows.Controls.Ribbon;
using System.Windows.Input;
using System.Windows;

namespace Southridge.WorkArounds
{
    internal class MoreRecentHighLightListWCommand : RibbonHighlightingList 
    {

        public ICommand Command
        {
            get { return (ICommand)GetValue(CommandProperty); }
            set { SetValue(CommandProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Command.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty CommandProperty =
            DependencyProperty.Register("Command", typeof(ICommand), typeof(MoreRecentHighLightListWCommand), new UIPropertyMetadata(null));


        public override void OnMostRecentFileSelected(MostRecentFileSelectedEventArgs e)
        {

            base.OnMostRecentFileSelected(e);
            ICommand cmd = Command;
            if (cmd != null)
            {                 
                cmd.Execute(e.SelectedItem);
            } 
            
        }        
    }
}
